-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(api): Update remaining webhook routes to modular structure #2252
Conversation
2f33404
to
ad08273
Compare
b9babd2
to
7279188
Compare
9243b20
to
409d2ca
Compare
Removed vultr server and associated DNS entries |
eeed25d
to
d94b65e
Compare
@@ -25,13 +25,18 @@ type RequiredScheduledEventArgs = Pick< | |||
"webhook" | "schedule_at" | "comment" | "payload" | |||
>; | |||
|
|||
export interface ScheduledEventResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typing this cascaded across a few functions and tests which is a bit noisy for a PR, but quite nice in practice.
@@ -14,9 +17,9 @@ enum Destination { | |||
} | |||
|
|||
interface CombinedResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is repeated in api.planx.uk/send/createSendEvents.ts
but I'm ignoring this for now as this PR is already bigger than it should be.
payload: payload, | ||
comment: `expiry_${payload.sessionId}`, | ||
}); | ||
return [response]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning [response]
as opposed to just response
gives us a consistent return type across all these APIs.
What does this PR do?
/webhook
routes to format proposed here